import request from '@/utils/request'

// 查询部署位置列表
export function listDeploymentLocation(query) {
  return request({
    url: '/device/deploymentLocation/list',
    method: 'get',
    params: query
  })
}

// 查询部署位置列表（排除节点）
export function listDeploymentLocationExcludeChild(id) {
  return request({
    url: '/device/deploymentLocation/list/exclude/' + id,
    method: 'get'
  })
}

// 查询部署位置详细
export function getDeploymentLocation(id) {
  return request({
    url: '/device/deploymentLocation/' + id,
    method: 'get'
  })
}

// 新增部署位置
export function addDeploymentLocation(data) {
  return request({
    url: '/device/deploymentLocation/add',
    method: 'post',
    data: data
  })
}

// 修改部署位置
export function updateDeploymentLocation(data) {
  return request({
    url: '/device/deploymentLocation/edit',
    method: 'post',
    data: data
  })
}

// 删除部署位置
export function delDeploymentLocation(id) {
  return request({
    url: '/device/deploymentLocation/delete/' + id,
    method: 'delete'
  })
}
// 查询部署位置列表
export function deploymentLocationAllList() {
  return request({
    url: '/device/deploymentLocation/deploymentLocationAllList',
    method: 'get',
  })
}

// 查询路段
export function getDeploymentLocationByClassLevel(type) {
  return request({
    url: '/device/deploymentLocation/getDeploymentLocationByLocationType?type='+type,
    method: 'get',
  })
}
// 获取场地/位置
export function getChildrenListByParentId(parentId) {
  return request({
    url: '/device/deploymentLocation/getChildrenListByParentId?parentId='+parentId,
    method: 'get',
  })
}
// 查询部署位置下拉树结构
export function treeselect() {
  return request({
    url: '/device/deploymentLocation/treeselect',
    method: 'get'
  })
}

// 查询部署位置树
export function deploymentLocationTree() {
  return request({
    url: '/device/deploymentLocation/deploymentLocationTree',
    method: 'get'
  })
}
